package indi.yuluo.service.impl;

import indi.yuluo.dao.UserRoleMapper;
import indi.yuluo.service.UserRoleService;
import org.springframework.stereotype.Service;
import org.springframework.test.annotation.Rollback;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;

/**
 * @Author: yuluo
 * @CreateTime: 2022-08-27  17:13
 * @Description: TODO
 */

@Service
public class UserRoleServiceImpl implements UserRoleService {

    @Resource
    private UserRoleMapper userRoleMapper;


    @Override
    @Transactional(transactionManager = "transactionManager")
    @Rollback(value=false)
    public boolean saveUserRole(Long uuid) {

        boolean flag = false;

        int res = userRoleMapper.save(uuid);

        if (res != 0) {
            flag = true;
        }

        return flag;
    }
}
